using MicroMsg.Manager;
using MicroMsg.Storage;
using MicroMsg.UI.Page;
using MicroMsg.UI.UserContrl;
using System;
namespace MicroMsg.UI.Util
{
	public class ViewContactDetailMgr
	{
		private const string strUrlMMContactDetail = "";
		private const string strUrlQQContactDetail = "";
		public static void ViewContactDetailByName(string strUserName)
		{
		}
		public static void ViewContactDetail(string strUserName)
		{
		}
		public static ContactDetailViewArgs getConDetailArgFromFMessageValidInfo(FMessageValidInfo info)
		{
			Contact contact = StorageMgr.contact.method_0(info.UserName);
			if (contact == null)
			{
				contact = new Contact
				{
					strUsrName = info.UserName,
					strNickName = info.NickName,
					strProvince = info.province,
					strCity = info.city,
					strPYInitial = info.shortpy,
					nSex = info.int_0,
					strVerifyInfo = info.ConversationInfo,
					nImgFlag = (uint)info.imagestatus
				};
			}
			return new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = "好友验证",
				mStrSecondTitle = "详细资料",
				mFromType = ContactDetailFromType.FROM_FRIENDVERIFY,
				mObject = info
			};
		}
		public static ContactDetailViewArgs getConDetailArgFromFMessageFriendInfo(FMessageFriendInfo info)
		{
			Contact contact = StorageMgr.contact.method_0(info.UserName);
			if (contact == null)
			{
				contact = new Contact
				{
					strUsrName = info.UserName,
					strNickName = info.NickName,
					strPYInitial = info.pyInitial,
					strVerifyInfo = info.ConversationInfo,
					nImgFlag = (uint)info.imageFlag
				};
			}
			int scene = info.scene;
			ContactDetailFromType mFromType;
			if (scene != 4)
			{
				if (scene != 10)
				{
					mFromType = ContactDetailFromType.FROM_FRIENDPUSH_MAYKNOW;
				}
				else
				{
					mFromType = ContactDetailFromType.FROM_FRIENDPUSH_MOBILE;
				}
			}
			else
			{
				mFromType = ContactDetailFromType.FROM_FRIENDPUSH_QQ;
			}
			return new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = "好友推荐",
				mStrSecondTitle = "详细资料",
				mFromType = mFromType,
				mObject = info
			};
		}
		public static bool GotoContactDitailView(string strFirstTitle, string strSecondTitle, Contact contact, ContactDetailFromType fromType, bool bIsRemoveCurrentPage = false)
		{
			if (contact == null)
			{
				return false;
			}
			ToolFunction.GotoPageForUserControl("/Source/UI/Contact/ContactDetailViewForAll.xaml", new object[]
			{
				new ContactDetailViewArgs
				{
					mContact = contact,
					mFromType = fromType,
					mStrFirstTitle = strFirstTitle,
					mStrSecondTitle = strSecondTitle
				}
			}, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(FMessageValidInfo info, bool bIsRemoveCurrentPage = false)
		{
			if (info == null)
			{
				return false;
			}
			ContactDetailViewArgs conDetailArgFromFMessageValidInfo = ViewContactDetailMgr.getConDetailArgFromFMessageValidInfo(info);
			if (info == null)
			{
				return false;
			}
			ToolFunction.GotoPageForUserControl("/Source/UI/Contact/ContactDetailViewForAll.xaml", new object[]
			{
				conDetailArgFromFMessageValidInfo
			}, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(FMessageFriendInfo info, bool bIsRemoveCurrentPage = false)
		{
			if (info == null)
			{
				return false;
			}
			ContactDetailViewArgs conDetailArgFromFMessageFriendInfo = ViewContactDetailMgr.getConDetailArgFromFMessageFriendInfo(info);
			if (info == null)
			{
				return false;
			}
			ToolFunction.GotoPageForUserControl("/Source/UI/Contact/ContactDetailViewForAll.xaml", new object[]
			{
				conDetailArgFromFMessageFriendInfo
			}, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(ContactDetailViewArgs contactDetailArg, bool bIsRemoveCurrentPage = false)
		{
			if (contactDetailArg != null && contactDetailArg.mContact != null)
			{
				ToolFunction.GotoPageForUserControl("/Source/UI/Contact/ContactDetailViewForAll.xaml", new object[]
				{
					contactDetailArg
				}, bIsRemoveCurrentPage);
				return true;
			}
			return false;
		}
	}
}
